package com.wy.powerbuilder.mapper.ljh;

import com.wy.powerbuilder.entity.ljh.Device;
import com.wy.powerbuilder.entity.ljh.Type;
import com.wy.powerbuilder.entity.lwg.houses;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeviceMapper {
    List<Device> selAll(String model);
    @Select("select * from houses")
    List<houses> seleAll();
    @Select("select * from device_type")
    List<Type> all();
    @Insert("INSERT INTO device VALUES (NULL,#{h_buliding},#{devicename},#{type},#{model},#{state},#{a_date},#{location})")
    int addDevice(Device device);
    @Delete("delete from device where deviceid=#{deviceid}")
    int delDevice(Integer deviceid);
    @Select("select * from device where deviceid=#{deviceid} ")
    Device seldeviceId(Integer deviceid);
    @Update("update device set  h_buliding=#{h_buliding},devicename=#{devicename},type=#{type},model=#{model},state=#{state},a_date=#{a_date},location=#{location} where deviceid=#{deviceid}")
    int updDevice(Device device);
}
